<?php

declare (strict_types=1);

namespace App\Model;

use Hyperf\DbConnection\Model\Model;

class RoomsModel extends Model
{


    protected $table = 'rooms';

    protected $fillable = [
        'owner',
        'type',
        'number',
        'lai_zi',
        'score',
        'round_counts',
        'rent',
        'rent_uid',
        'capping',
        'has_zi_pai',
    ];

    protected $casts = [
        'lai_zi' => 'array',
        'has_zi_pai' => 'boolean'
    ];

    /**
     * 回合
     * @return \Hyperf\Database\Model\Relations\HasMany
     */
    public function Rounds()
    {
        return $this->hasMany(RoundsModel::class, 'rooms_id');
    }
}